com.sponsorpay.sdk.android.advertiser
Class SponsorPayCallbackDelayer
java.lang.Object
BroadcastReceiver
com.sponsorpay.sdk.android.advertiser.SponsorPayCallbackDelayer
public class SponsorPayCallbackDelayer
- extends BroadcastReceiver
Enables triggering the advertiser's callback with a delay. Uses the Android alarm mechanism provided by
AlarmManager
.
Method Summary |
static void |
callWithDelay(Context context,
java.lang.String offerId,
long delayMinutes)
Triggers the Advertiser callback after the specified delay has passed. |
void |
onReceive(Context context,
Intent intent)
onReceived method overridden from BroadcastReceiver . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ACTION_TRIGGER_SPONSORPAY_CALLBACK
public static final java.lang.String ACTION_TRIGGER_SPONSORPAY_CALLBACK
- See Also:
- Constant Field Values
EXTRA_OFFERID_KEY
public static final java.lang.String EXTRA_OFFERID_KEY
- See Also:
- Constant Field Values
MILLISECONDS_IN_MINUTE
public static final int MILLISECONDS_IN_MINUTE
- See Also:
- Constant Field Values
SponsorPayCallbackDelayer
public SponsorPayCallbackDelayer()
callWithDelay
public static void callWithDelay(Context context,
java.lang.String offerId,
long delayMinutes)
- Triggers the Advertiser callback after the specified delay has passed. Will use the provided offer ID instead of
trying to retrieve the one defined in the host application's manifest. Registers an alarm with the OS
AlarmManager
. onReceive(Context, Intent)
will be invoked when the specified period of time has
elapsed .
- Parameters:
context
- Host application context.offerId
- The offer id to use.delayMinutes
- The delay in minutes for triggering the Advertiser callback.
onReceive
public void onReceive(Context context,
Intent intent)
- onReceived method overridden from
BroadcastReceiver
. Performs the actual triggering of the callback.